package com.itheima.demo;

import java.io.IOException;
import java.io.InputStream;
import java.util.Properties;
import java.util.Set;

/**
 * @author Zhang_Han
 * @version 1.0
 * @date 2020/7/17 10:38
 */
public class Demo_001 {
    public static void main(String[] args) throws IOException {
        //获取系统类加载器;
        ClassLoader systemClassLoader = ClassLoader.getSystemClassLoader();

        InputStream is = systemClassLoader.getResourceAsStream("pro.properties");

        Properties pro = new Properties();

        pro.load(is);

        //System.out.println(pro);
        Set<String> key = pro.stringPropertyNames();
        for (String s : key) {
            String value = pro.getProperty(s);
            System.out.println(s + "=" + value);
        }
        is.close();

    }
}
